﻿using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WheelClean2.Model
{
    /// <summary>
    /// 当前报警信息
    /// </summary>
   public class CurrentAlarm : BindableBase
    {
        [Key]
        public int ID { get; set; }

        private int? _alarmID;
        /// <summary>
        /// 关联AlarmInfo.AlarmID 
        /// </summary>
        [ForeignKey("AlarmInfo")]
        public int? AlarmID
        {
            get { return _alarmID; }
            set { SetProperty(ref _alarmID, value); }
        }

        //private AlarmInfo? _alarmInfo;
        ///// <summary>
        ///// 关联AlarmInfo.AlarmID 
        ///// </summary>
        //public AlarmInfo? AlarmInfo
        //{
        //    get { return _alarmInfo; }
        //    set { SetProperty(ref _alarmInfo, value); }
        //}
        private DateTime? _triggerTime;
        /// <summary>
        /// 触发时间
        /// </summary>
        public DateTime? TriggerTime
        {
            get { return _triggerTime; }
            set { SetProperty(ref _triggerTime, value); }
        }
        private int? _triggerValue;
        /// <summary>
        /// 触发时的值
        /// </summary>
        public int? TriggerValue
        {
            get { return _triggerValue; }
            set { SetProperty(ref _triggerValue, value); }
        }
        private int? _currentStatus;
        /// <summary>
        /// 当前状态(0:未确认,1:已确认,2:已消除)
        /// </summary>
        public int? CurrentStatus
        {
            get { return _currentStatus; }
            set { SetProperty(ref _currentStatus, value); }
        }

        //private string _CurrentStatusString;
        ///// <summary>
        ///// 当前状态(0:未确认,1:已确认,2:已消除)
        ///// </summary>
        //public string CurrentStatusString
        //{
        //    get { return _CurrentStatusString; }
        //    set { SetProperty(ref _CurrentStatusString, value); }
        //}
        
        private DateTime? _confirmTime;
        /// <summary>
        /// 确认时间
        /// </summary>
        public DateTime? ConfirmTime
        {
            get { return _confirmTime; }
            set { SetProperty(ref _confirmTime, value); }
        }
        private string _confirmUser;
        /// <summary>
        /// 确认人
        /// </summary>
        public string ConfirmUser
        {
            get { return _confirmUser; }
            set { SetProperty(ref _confirmUser, value); }
        }
        private DateTime? _endTime;
        /// <summary>
        /// 结束时间
        /// </summary>
        public DateTime? EndTime
        {
            get { return _endTime; }
            set { SetProperty(ref _endTime, value); }
        }

        public virtual AlarmInfo AlarmInfo { get; set; }

    }
}
